Rules for integrands of the form(((a (x^q)+b (x^n)+c (x^(2n-q))))^p)

1:  ∫(((a (x^n)+b (x^n)+c (x^n)))^p)dx

Rule:

∫(((a (x^n)+b (x^n)+c (x^n)))^p)dx  ⟶  ∫((((a+b+c) (x^n)))^p)dx

Program code:

Int[(a_.*x_^q_.+b_.*x_^n_.+c_.*x_^r_.)^p_,x_Symbol] :=
  Int[((a+b+c)*x^n)^p,x] /;
FreeQ[{a,b,c,n,p},x] && EqQ[n,q] && EqQ[r,n]

2:  ∫(((a (x^q)+b (x^n)+c (x^(2n-q))))^p)dx  when q<n ∧ p∈ℤ

Rule: If  q<n ∧ p∈ℤ, then

∫(((a (x^q)+b (x^n)+c (x^(2n-q))))^p)dx  ⟶  ∫(x^(p q))(((a+b (x^(n-q))+c (x^(2(n-q)))))^p)dx

Program code:

Int[(a_.*x_^q_.+b_.*x_^n_.+c_.*x_^r_.)^p_,x_Symbol] :=
  Int[x^(p*q)*(a+b*x^(n-q)+c*x^(2*(n-q)))^p,x] /;
FreeQ[{a,b,c,n,q},x] && EqQ[r,2*n-q] && PosQ[n-q] && IntegerQ[p]

3:  ∫(Sqrt[a (x^q)+b (x^n)+c (x^(2n-q))])dx  when q<n

Derivation: Piecewise constant extraction

Basis:  (∂_x)((Sqrt[a (x^q)+b (x^n)+c (x^(2n-q))])/((x^(q/2)) (Sqrt[a+b (x^(n-q))+c (x^(2(n-q)))])))==0

Rule: If  q<n, then

∫(Sqrt[a (x^q)+b (x^n)+c (x^(2n-q))])dx  ⟶  ((Sqrt[a (x^q)+b (x^n)+c (x^(2n-q))])/((x^(q/2)) (Sqrt[a+b (x^(n-q))+c (x^(2(n-q)))])))∫(x^(q/2)) (Sqrt[a+b (x^(n-q))+c (x^(2(n-q)))])dx

Program code:

Int[Sqrt[a_.*x_^q_.+b_.*x_^n_.+c_.*x_^r_.],x_Symbol] :=
  Sqrt[a*x^q+b*x^n+c*x^(2*n-q)]/(x^(q/2)*Sqrt[a+b*x^(n-q)+c*x^(2*(n-q))])*
    Int[x^(q/2)*Sqrt[a+b*x^(n-q)+c*x^(2*(n-q))],x] /;
FreeQ[{a,b,c,n,q},x] && EqQ[r,2*n-q] && PosQ[n-q]

4.  ∫(1/(Sqrt[a (x^q)+b (x^n)+c (x^(2 n-q))]))dx  when 2<n ∧ (b^2)-4 a c≠0

1:  ∫(1/(Sqrt[a (x^2)+b (x^n)+c (x^(2 n-2))]))dx  when 2<n ∧ (b^2)-4 a c≠0

Derivation: Integration by substitution

Basis:  (1/(Sqrt[a (x^2)+b (x^n)+c (x^(2 n-2))]))==-(2/(n-2)) Subst[(1/(4 a-(x^2))),x,((x (2 a+b (x^(n-2))))/(Sqrt[a (x^2)+b (x^n)+c (x^(2 n-2))]))] (∂_x)((x (2 a+b (x^(n-2))))/(Sqrt[a (x^2)+b (x^n)+c (x^(2 n-2))]))

Rule: If  2<n ∧ (b^2)-4 a c≠0, then

∫(1/(Sqrt[a (x^2)+b (x^n)+c (x^(2 n-2))]))dx  ⟶  -(2/(n-2)) Subst[∫(1/(4 a-(x^2)))dx,x,((x (2 a+b (x^(n-2))))/(Sqrt[a (x^2)+b (x^n)+c (x^(2 n-2))]))]

Program code:

Int[1/Sqrt[a_.*x_^2+b_.*x_^n_.+c_.*x_^r_.],x_Symbol] :=
  -2/(n-2)*Subst[Int[1/(4*a-x^2),x],x,x*(2*a+b*x^(n-2))/Sqrt[a*x^2+b*x^n+c*x^r]] /;
FreeQ[{a,b,c,n,r},x] && EqQ[r,2*n-2] && PosQ[n-2] && NeQ[b^2-4*a*c,0]

2:  ∫(1/(Sqrt[a (x^q)+b (x^n)+c (x^(2 n-q))]))dx  when q<n

Derivation: Piecewise constant extraction

Basis:  (∂_x)(((x^(q/2)) (Sqrt[a+b (x^(n-q))+c (x^(2(n-q)))]))/(Sqrt[a (x^q)+b (x^n)+c (x^(2n-q))]))==0

Rule: If  q<n, then

∫(1/(Sqrt[a (x^q)+b (x^n)+c (x^(2 n-q))]))dx  ⟶  (((x^(q/2)) (Sqrt[a+b (x^(n-q))+c (x^(2(n-q)))]))/(Sqrt[a (x^q)+b (x^n)+c (x^(2n-q))]))∫(1/((x^(q/2)) (Sqrt[a+b (x^(n-q))+c (x^(2(n-q)))])))dx

Program code:

Int[1/Sqrt[a_.*x_^q_.+b_.*x_^n_.+c_.*x_^r_.],x_Symbol] :=
  x^(q/2)*Sqrt[a+b*x^(n-q)+c*x^(2*(n-q))]/Sqrt[a*x^q+b*x^n+c*x^(2*n-q)]*
    Int[1/(x^(q/2)*Sqrt[a+b*x^(n-q)+c*x^(2*(n-q))]),x] /;
FreeQ[{a,b,c,n,q},x] && EqQ[r,2*n-q] && PosQ[n-q]

5:  ∫(((a (x^q)+b (x^n)+c (x^(2n-q))))^p)dx  when q<n ∧ p∉ℤ ∧ (b^2)-4a c≠0 ∧ p>0 ∧ p(2 n-q)+1≠0

Derivation: Generalized trinomial recurrence 1b with m=0, A=1 and B=0

Rule: If  q<n ∧ p∉ℤ ∧ (b^2)-4a c≠0 ∧ p>0 ∧ p(2 n-q)+1≠0, then

∫(((a (x^q)+b (x^n)+c (x^(2n-q))))^p)dx  ⟶  ((x(((a (x^q)+b (x^n)+c (x^(2 n-q))))^p))/(p(2 n-q)+1))+(((n-q) p)/(p(2 n-q)+1))∫(x^q) (2 a+b (x^(n-q)))(((a (x^q)+b (x^n)+c (x^(2 n-q))))^(p-1))dx

Program code:

Int[(a_.*x_^q_.+b_.*x_^n_.+c_.*x_^r_.)^p_,x_Symbol] :=
  x*(a*x^q+b*x^n+c*x^(2*n-q))^p/(p*(2*n-q)+1) + 
  (n-q)*p/(p*(2*n-q)+1)*
    Int[x^q*(2*a+b*x^(n-q))*(a*x^q+b*x^n+c*x^(2*n-q))^(p-1),x] /;
FreeQ[{a,b,c,n,q},x] && EqQ[r,2*n-q] && PosQ[n-q] && Not[IntegerQ[p]] && NeQ[b^2-4*a*c,0] && GtQ[p,0] && NeQ[p*(2*n-q)+1,0]

6:  ∫(((a (x^q)+b (x^n)+c (x^(2n-q))))^p)dx  when q<n ∧ p∉ℤ ∧ (b^2)-4a c≠0 ∧ p<-1

Derivation: Generalized trinomial recurrence 2b with m=0, A=1 and B=0

Rule: If  q<n ∧ p∉ℤ ∧ (b^2)-4a c≠0 ∧ p<-1, then

∫(((a (x^q)+b (x^n)+c (x^(2n-q))))^p)dx  ⟶  
-(((x^(-q+1)) ((b^2)-2 a c+b c (x^(n-q)))(((a (x^q)+b (x^n)+c (x^(2 n-q))))^(p+1)))/(a (n-q)(p+1) ((b^2)-4 a c)))+(1/(a (n-q)(p+1) ((b^2)-4 a c)))·
∫(x^(-q)) ((p q+1)((b^2)-2 a c)+(n-q)(p+1) ((b^2)-4 a c)+b c(p q+(n-q) (2p+3)+1)(x^(n-q)))(((a (x^q)+b (x^n)+c (x^(2 n-q))))^(p+1))dx

Program code:

Int[(a_.*x_^q_.+b_.*x_^n_.+c_.*x_^r_.)^p_,x_Symbol] :=
  -x^(-q+1)*(b^2-2*a*c+b*c*x^(n-q))*(a*x^q+b*x^n+c*x^(2*n-q))^(p+1)/(a*(n-q)*(p+1)*(b^2-4*a*c)) + 
  1/(a*(n-q)*(p+1)*(b^2-4*a*c))*
    Int[x^(-q)*((p*q+1)*(b^2-2*a*c)+(n-q)*(p+1)*(b^2-4*a*c)+b*c*(p*q+(n-q)*(2*p+3)+1)*x^(n-q))*(a*x^q+b*x^n+c*x^(2*n-q))^(p+1),x] /;
FreeQ[{a,b,c,n,q},x] && EqQ[r,2*n-q] && PosQ[n-q] && Not[IntegerQ[p]] && NeQ[b^2-4*a*c,0] && LtQ[p,-1]

7:  ∫(((a (x^q)+b (x^n)+c (x^(2n-q))))^p)dx  when q<n ∧ p∉ℤ

Derivation: Piecewise constant extraction

Basis:  (∂_x)((((a (x^q)+b (x^n)+c (x^(2n-q))))^p)/((x^(p q)) (((a+b (x^(n-q))+c (x^(2(n-q)))))^p)))==0

Rule: If  q<n ∧ p∉ℤ, then

∫(((a (x^q)+b (x^n)+c (x^(2n-q))))^p)dx  ⟶  ((((a (x^q)+b (x^n)+c (x^(2n-q))))^p)/((x^(p q)) (((a+b (x^(n-q))+c (x^(2(n-q)))))^p)))∫(x^(p q)) (((a+b (x^(n-q))+c (x^(2(n-q)))))^p)dx

Program code:

Int[(a_.*x_^q_.+b_.*x_^n_.+c_.*x_^r_.)^p_,x_Symbol] :=
  (a*x^q+b*x^n+c*x^(2*n-q))^p/(x^(p*q)*(a+b*x^(n-q)+c*x^(2*(n-q)))^p)*
    Int[x^(p*q)*(a+b*x^(n-q)+c*x^(2*(n-q)))^p,x] /;
FreeQ[{a,b,c,n,p,q},x] && EqQ[r,2*n-q] && PosQ[n-q] && Not[IntegerQ[p]]

X:  ∫(((a (x^q)+b (x^n)+c (x^(2n-q))))^p)dx

Rule:

∫(((a (x^q)+b (x^n)+c (x^(2n-q))))^p)dx  ⟶  ∫(((a (x^q)+b (x^n)+c (x^(2n-q))))^p)dx

Program code:

Int[(a_.*x_^q_.+b_.*x_^n_.+c_.*x_^r_.)^p_,x_Symbol] :=
  Unintegrable[(a*x^q+b*x^n+c*x^(2*n-q))^p,x] /;
FreeQ[{a,b,c,n,p,q},x] && EqQ[r,2*n-q]

S:  ∫(((a (u^q)+b (u^n)+c (u^(2n-q))))^p)dx  when  u==d+e x

Derivation: Integration by substitution

Rule: If  u==d+e x, then

∫(((a (u^q)+b (u^n)+c (u^(2n-q))))^p)dx  ⟶  (1/e)Subst[∫(((a (x^q)+b (x^n)+c (x^(2n-q))))^p)dx,x,u]

Program code:

Int[(a_.*u_^q_.+b_.*u_^n_.+c_.*u_^r_.)^p_,x_Symbol] :=
  1/Coefficient[u,x,1]*Subst[Int[(a*x^q+b*x^n+c*x^(2*n-q))^p,x],x,u] /;
FreeQ[{a,b,c,n,p,q},x] && EqQ[r,2*n-q] && LinearQ[u,x] && NeQ[u,x]